// src/renderer/src/components/git/js/entity/Task.ts
export class Task {
  private _id: number;
  private _name: string;
  private _cronExpression: string;
  private _filePaths: string[];
  private _isActive: boolean;

  constructor(id: number, name: string, cronExpression: string, filePaths: string[], isActive: boolean = false) {
    this._id = id;
    this._name = name;
    this._cronExpression = cronExpression;
    this._filePaths = filePaths;
    this._isActive = isActive;
  }


  get id(): number {
    return this._id;
  }

  set id(value: number) {
    this._id = value;
  }

  get name(): string {
    return this._name;
  }

  set name(value: string) {
    this._name = value;
  }

  get cronExpression(): string {
    return this._cronExpression;
  }

  set cronExpression(value: string) {
    this._cronExpression = value;
  }

  get filePaths(): string[] {
    return this._filePaths;
  }

  set filePaths(value: string[]) {
    this._filePaths = value;
  }

  get isActive(): boolean {
    return this._isActive;
  }

  set isActive(value: boolean) {
    this._isActive = value;
  }

  /**
   * 激活任务
   */
  activate(): void {
    this._isActive = true;
  }

  /**
   * 停止任务
   */
  deactivate(): void {
    this._isActive = false;
  }
}
